﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyBanHang.VO;
using QuanLyBanHang.BUS;

namespace QuanLyBanHang
{
    public partial class Form_LogIn : Form
    {
        NhanVien_BUS nv_bus;
        Form_main frm_main;
        public Form_LogIn()
        {
            InitializeComponent();
            //this.IsMdiContainer = true;
            nv_bus = new NhanVien_BUS();
            frm_main = new Form_main(new NhanVien_VO(),this);
            //frm_main.MdiParent = this;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            NhanVien_VO nv = new NhanVien_VO();
            nv = nv_bus.Validate(textBox_tk.Text, textBox_mk.Text);
            if (nv != null)
            {
                Form_main frm = new Form_main(nv,this);
                frm.Show();
                this.Hide();
                //this.Close();
                //Application.Run(new Form_main(nv));
                //frm_main = new Form_main(nv);
                //frm_main.Show();
                //this.ActivateMdiChild(frm_main);
                //this.Hide();
                //frm_main.Show();
                
                
            }
        }

        private void button_exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Form_LogIn_Load(object sender, EventArgs e)
        {

        }

        private void textBox_tk_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
